//
//  UIButton+Custom.m
//  跑跑快销
//
//  Created by 杨潇 on 14-4-29.
//  Copyright (c) 2014年 ylife. All rights reserved.
//

#import "UIButton+Custom.h"

@implementation UIButton (Custom)

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

+ (id)buttonWithType:(UIButtonType)buttonType rect:(CGRect)rect color:(UIColor*)color withImgName:(NSString *)imgStr addObj:(UIView *)addVi
{
    UIButton * button = [UIButton buttonWithType:buttonType];
    button.frame = rect;
    button.backgroundColor = color;
    if (imgStr) {
        [button setImage:[UIImage imageNamed:imgStr] forState:UIControlStateNormal];
    }
    button.layer.cornerRadius = 6;
    [addVi addSubview:button];
    return button;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
